home *** CD-ROM | disk | FTP | other *** search
- * @demtable demonstrates the table command.
- * table: transforms a grey value image using a look-up table.
- *
- * The grey value g from the input image (first parameter) is used
- * as table address, the content found there becomes the grey value
- * h in the output image (second parameter).
- shad a
- copy a b 1 1 0 1 1 0
- *transposed
- * Several tables can be generated (third parameter, t):
- * t=0: (h/255)=(g/255)**(j/k);
- table a d 0 1 2
- * j/k=1/2, power, square root
- add b d
- th d d 1 127
- table a d 0 2 1
- * j/k=2/1, power, square
- add b d
- th d d 1 127
- * t=0: (h/255)=g**(j/k), for j/k<0 different scaling: g instead of g/255;
- table a d 0 -1 1
- * j/k=-1/1, neg.power
- add b d
- th d d 1 127
- * t=2: (h/255)=(k/g)**j;
- table a d 2 1 1
- * 255/g, reciprocal
- add b d
- th d d 1 127
- * t=1: (h/255)=(j/k)**((g/255)-1); j=0 -> j/k=e;
- table a d 1 10 1
- * exponential, base 10
- add b d
- th d d 1 127
- table a d 1 0 1
- * exponential, base e
- add b d
- th d d 1 127
- * t=-1: (h/255)-1=log(g/255)/log(j/k);
- table a d -1 10 1 1
- * logarithm, base 10
- add b d
- th d d 1 127
- table a d -1 0 1 1
- * logarithm, base e
- add b d
- th d d 1 127
- * t=3: pi2 (h-127-j)/127=atan((k/100) pi2 (g-127)/128 - tan(pi2 j/127)); pi2=pi/2;
- * t=3: h =atan((k/100) g - (k/100) gj );
- table a d 3 0 100 1
- * arctangent S-curve
- add b d
- th d d 1 127
- * t=-3: pi2 (h-127)/128=(tan(pi2 (g-127-j)/127)+tan(pi2 j/127)) /(k/100); pi2=pi/2;
- * t=-3: h =(tan (g -j) + (k/100) gj ) /(k/100);
- table a d -3 0 100 1
- * tangent inverse S-curve
- add b d
- th d d 1 127
- * t=4: g=(x+8)+16*(y+8)->h=phi*16/2pi+16*r;
- cdiv a 16 c *steps x-axis 0 1 2 ... 15
- cdiv b 16 d
- cmul d 16 *steps y-axis 0 16 32 .. 240
- sub d c 15 d *0+15 0+14 .. 0+0, 16+15 .. 16+0 ,, 240+15 .. 240+0
- table d c 4
- cdiv c 16 d
- cmul d 16
- sub c d 0 c
- * cartesian to polar
- add d c
- * t=-4: inverse of t=4;
- table c d -4
- * polar to cartesian
- cdiv d 16 c
- cmul c 16
- sub d c 0 d
- * t=5: (h-127)/127=cos((g/255)**(j/100) *k*2pi);
- * t=5: h =cos( g**j *k*2pi);
- table a d 5 100 1
- * cosine
- add b d
- th d d 1 127
- table a d 5 200 5
- * chirped cosine
- add b d
- th d d 1 127
- * t=-5: (h-127)/127=sin((g/255)**(j/100) *k*2pi);
- * t=-5: h =sin( g**j *k*2pi);
- table a d -5 100 1 1
- * sine
- add b d
- th d d 1 127
- table a d -5 200 5 1
- * chirped sine
- add b d
- th d d 1 127
- * t=6: 8 thresholds j,j+k,,j+7k;
- table a d 6 30 20 1
- bd d 1 * thr 30
- bd d 2 * thr 50
- bd d 3 * thr 70
- bd d 4 * thr 90
- bd d 5 * thr 110
- bd d 6 * thr 130
- bd d 7 * thr 150
- bd d 8 * thr 170
- * t=-6: j=lower, k=higher threshold;
- table a d -6 85 170 1
- add b d
- th d d 1 127
- * t=7: (h-127)/127=-log( (254/g)-1 )/log(253);
- table a c 7
- * symmetric logarithm, log( (254/g)-1 ) = log(254-g)-log(g);
- add b c d
- th d d 1 127
- * t=-7: (254/h)-1= exp( -((g-127)/127) log(253) );
- table c d -7
- * inverse of symmetric logarithm
- add b d
- th d d 1 127
- * t=8: (h/255)=( a**(g/255) + a**(-g/255) -2) / (a+1/a-2); a=j/k;
- table a d 8 0 1
- * cosinus hyperbolicus -1, base e
- add b d
- th d d 1 127
- * t=-8: (h/255)=log( (g/255) +1 + sqrt( ((g/255) +1)**2-1) ))/log(j/k);
- table a d -8 0 1
- * inverse of cosh-1, base e
- add b d
- th d d 1 127
- * Fourth para.(r) reflects table: r=1: normal, default;
- table a d 0 2 1 1 *square
- add b d
- th d d 1 127
- * r=2: g->-g;
- table a d 0 2 1 2
- add b d
- th d d 1 127
- * r=3: g->-g, h->-h;
- table a d 0 2 1 3
- add b d
- th d d 1 127
- * r=4: h->-h;
- table a d 0 2 1 4
- add b d
- th d d 1 127
- * r=5: g->|g|;
- table a d 0 2 1 5
- add b d
- th d d 1 127
- * r=6: g->|g|, h-> |h|*sgn(g),
- table a d 0 2 1 6
- add b d
- th d d 1 127
- * r<0: h->h+r[mod256].
- table a d 0 2 1 -16
- add b d
- th d d 1 127
-